
################################################################################################################# DEBUG/RELEASE MODE

############################ DOC CL OPTIONS

# -MTd   : Creates a debug multithreaded executable file, No need to define _DEBUG, compiler does it for us if -MTd flag is on
# -DGSL_RANGE_CHECK : tells the mat lib to do range checking
# -Zi    : Generates complete debugging information
# -nolog : In brief, the positive form suppresses the logo at startup and the negative form makes explicit that this suppression is not wanted. However, there are some other effects. 
# -O2 	 : Creates fast code
# -W3 	 : Sets warning level
# -MT 	 : Causes your application to use the multithread, static version of the run-time library. 
#     	   Defines _MT and causes the compiler to place the library name LIBCMT.lib into the .obj file 
#     	   so that the linker will use LIBCMT.lib to resolve external symbols.
# -MD 	 : Causes your application to use the multithread- and DLL-specific version of the run-time library
#     	   Defines _MT and _DLL and causes the compiler to place the library name MSVCRT.lib into the .obj file.
#    	   Applications compiled with this option are statically linked to MSVCRT.lib. 
#     	   This library provides a layer of code that allows the linker to resolve external references. 
#     	   The actual working code is contained in MSVCR100.DLL, which must be available at run time to applications linked with MSVCRT.lib.
# -GF 	 : enable string pooling
# -Gy 	 : enable function-level linking
# -EHsc  : exception model to use : /EHsc -> intercept only C++ exceptions, extern C functions never launch C++ exception.
# 	   object files go to -Fo 

COMPILE_NUMPROC = -MP$(NUMBER_OF_PROCESSORS)

# We include setargv.obj for executables that do command line filename globbing.
# PROGRAMFILES is inherited from the shell evironment (where it is
# called ProgramFiles, but nmake converts it to upper case).  This allows us
# to work with systems that use \Program Files or \Program Files x86.
SETARGV = "$(PROGRAMFILES)/Microsoft Visual Studio 10.0/VC/lib/setargv.obj"

# we include binmode.obj so files are opened as _O_BINARY, for compat with unix
BINMODE = "$(PROGRAMFILES)/Microsoft Visual Studio 10.0/VC/lib/binmode.obj"

WINLIBS=advapi32.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib user32.lib vfw32.lib winmm.lib


############################ DIRECTORIES

LIBDIR =./lib
BINDIR =./bin

############################ INCLUDES

INC_OTHERS	= -I$(SW_DIST)\include
	
INC_SW    	= -I./include\
	
INC_VS		= -I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"\		  

INC_YARP	= -I"$(THIRD_PARTY_YARP32)"/include

############################ DEPENDENCIES

COMMON	 	    = $(INC_VS) $(INC_SW) $(INC_OTHERS)
#	hand teleoperation
SW_HAND_TELEOPERATION    = $(COMMON) $(INC_YARP)

############################ COMMON DEBUG/RELEASE LIBS

LIBS_COMMON	= "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\WS2_32.lib"

################################################################################################################# RELEASE MODE

!IF  "$(CFG)" == "Release"
	
############################ FLAGS

CFLAGS_STA = -nologo -O2 -GF -Gy -W3 -w44996 -w14189 -MT -EHsc -DWIN32 $(COMPILE_NUMPROC) 
CFLAGS_DYN = -nologo -O2 -GF -Gy -W3 -w44996 -w14189 -MD -EHsc -DWIN32 $(COMPILE_NUMPROC)

LFLAGS=-nologo -nodefaultlib:LIBCMT -nodefaultlib:LIBC -nodefaultlib:MSVCPRT
LFLAGS_SK=-nologo

############################ LIBS

LIBS_YARP		= 	$(THIRD_PARTY_YARP32)/lib/YARP_sig.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_OS.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_dev.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_init.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_math.lib\
				$(THIRD_PARTY_YARP32)/lib/yarpcar.lib\
				$(THIRD_PARTY_YARP32)/lib/yarp_bayer.lib\
				
LIBS_ACE		= 	$(THIRD_PARTY_ACE32)/lib/ACE.lib

LIBS_GSL		=	$(THIRD_PARTY_GSL32)/lib/gsl.lib\
				$(THIRD_PARTY_GSL32)/lib/gslcblas.lib
				
LIBS_ICUB		=	$(THIRD_PARTY_ICUB32)/lib/actionPrimitives.lib\
				$(THIRD_PARTY_ICUB32)/lib/boostMIL.lib\
				$(THIRD_PARTY_ICUB32)/lib/canLoaderLib.lib\
				$(THIRD_PARTY_ICUB32)/lib/cartesiancontrollerclient.lib\
				$(THIRD_PARTY_ICUB32)/lib/cartesiancontrollerserver.lib\
				$(THIRD_PARTY_ICUB32)/lib/controlboardwrapper2.lib\
				$(THIRD_PARTY_ICUB32)/lib/ctrlLib.lib\
				$(THIRD_PARTY_ICUB32)/lib/debugStream.lib\
				$(THIRD_PARTY_ICUB32)/lib/gazecontrollerclient.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubDev.lib\
				$(THIRD_PARTY_ICUB32)/lib/icubmod.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubTestLib.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubVis.lib\
				$(THIRD_PARTY_ICUB32)/lib/iDyn.lib\
				$(THIRD_PARTY_ICUB32)/lib/iKin.lib\
				$(THIRD_PARTY_ICUB32)/lib/learningMachine.lib\
				$(THIRD_PARTY_ICUB32)/lib/lib0.lib\
				$(THIRD_PARTY_ICUB32)/lib/lib1.lib\
				$(THIRD_PARTY_ICUB32)/lib/logpolar.lib\
				$(THIRD_PARTY_ICUB32)/lib/optimization.lib\
				$(THIRD_PARTY_ICUB32)/lib/perceptiveModels.lib\
				$(THIRD_PARTY_ICUB32)/lib/pmp.lib\
				$(THIRD_PARTY_ICUB32)/lib/sharksWithLasers.lib\
				$(THIRD_PARTY_ICUB32)/lib/skinDynLib.lib\
				$(THIRD_PARTY_ICUB32)/lib/TalkingHeadcalibrator.lib\
				
				
				
				
LIBS_HAND_TELEOPERATION	= $(LIBS_COMMON) $(LIBS_YARP) $(LIBS_ACE) $(LIBS_GSL) $(LIBS_ICUB)
	
!ENDIF

################################################################################################################# DEBUG MODE

!IF  "$(CFG)" == "Debug"

############################ FLAGS

CFLAGS_STA= -nologo -Zi -W2 -MTd -EHsc -DWIN32 $(COMPILE_NUMPROC) -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
CFLAGS_DYN= -nologo -Zi -W2 -MDd -EHsc -DWIN32 $(COMPILE_NUMPROC) -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH

LFLAGS=-nologo -nodefaultlib:LIBCMT -nodefaultlib:MSVCRT 
LFLAGS_SK=-nologo


############################ LIBS

LIBS_YARP		= 	$(THIRD_PARTY_YARP32)/lib/YARP_sigd.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_OSd.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_devd.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_initd.lib\
				$(THIRD_PARTY_YARP32)/lib/YARP_mathd.lib\
				$(THIRD_PARTY_YARP32)/lib/yarpcard.lib\
				$(THIRD_PARTY_YARP32)/lib/yarp_bayerd.lib\
				
LIBS_ACE		= 	$(THIRD_PARTY_ACE32)/lib/ACEd.lib

LIBS_GSL		=	$(THIRD_PARTY_GSL32)/lib/gsl.lib\
				$(THIRD_PARTY_GSL32)/lib/gslcblas.lib
				
LIBS_ICUB		=	$(THIRD_PARTY_ICUB32)/lib/actionPrimitivesd.lib\
				$(THIRD_PARTY_ICUB32)/lib/boostMILd.lib\
				$(THIRD_PARTY_ICUB32)/lib/canLoaderLibd.lib\
				$(THIRD_PARTY_ICUB32)/lib/cartesiancontrollerclientd.lib\
				$(THIRD_PARTY_ICUB32)/lib/cartesiancontrollerserverd.lib\
				$(THIRD_PARTY_ICUB32)/lib/controlboardwrapper2d.lib\
				$(THIRD_PARTY_ICUB32)/lib/ctrlLibd.lib\
				$(THIRD_PARTY_ICUB32)/lib/debugStreamd.lib\
				$(THIRD_PARTY_ICUB32)/lib/gazecontrollerclientd.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubDevd.lib\
				$(THIRD_PARTY_ICUB32)/lib/icubmodd.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubTestLibd.lib\
				$(THIRD_PARTY_ICUB32)/lib/iCubVisd.lib\
				$(THIRD_PARTY_ICUB32)/lib/iDynd.lib\
				$(THIRD_PARTY_ICUB32)/lib/iKind.lib\
				$(THIRD_PARTY_ICUB32)/lib/learningMachined.lib\
				$(THIRD_PARTY_ICUB32)/lib/lib0d.lib\
				$(THIRD_PARTY_ICUB32)/lib/lib1d.lib\
				$(THIRD_PARTY_ICUB32)/lib/logpolard.lib\
				$(THIRD_PARTY_ICUB32)/lib/optimizationd.lib\
				$(THIRD_PARTY_ICUB32)/lib/perceptiveModelsd.lib\
				$(THIRD_PARTY_ICUB32)/lib/pmpd.lib\
				$(THIRD_PARTY_ICUB32)/lib/sharksWithLasersd.lib\
				$(THIRD_PARTY_ICUB32)/lib/skinDynLibd.lib\
				$(THIRD_PARTY_ICUB32)/lib/TalkingHeadcalibratord.lib\ 
	
LIBS_HAND_TELEOPERATION	= $(LIBS_COMMON) $(LIBS_YARP) $(LIBS_ACE) $(LIBS_GSL) $(LIBS_ICUB)

!ENDIF
